< previous page page_319 next page >

Page 319
finds the first occurrence of an item, represented by the argument argString. The method sends the string via SendKeys to the executable. The method getFullRegKeyName returns the corresponding full key name that's in the Clipboard. This method works in conjunction with findFirstItem.
Using the Older INI File
If the Registry is not where you want to store user preferences, you might consider the traditional initialization file (INI). Many Visual Basic programmers find the INI file more friendly than the Registry, and thus still use it for user preferences and data source names. Listing 14.2 shows the code for the IniFile class.
LISTING 14.2. THE CODE FOR THEIniFileCLASS.

9f8044bafea36a1f728739c0bb58ef4c.gif
 1: VERSION 1.0 CLASS
 2: BEGIN
 3:   MultiUse = -1 'True
 4: END
 5: Attribute VB_Name = IniFile
 6: Attribute VB_GlobalNameSpace = False
 7: Attribute VB_Creatable = False
 8: Attribute VB_PredeclaredId = False
 9: Attribute VB_Exposed = False
10: Rem Purpose: Handles all interaction with INI files
11:
12: '.INI variables
13: Public DSN As String
14: Public mDbConnect As String, mODBCUser As String 'ODBCUser
15: Public mDbName As String 'Database name
16: Public mDRIVE As String
17: Public mPath As String
18: Public mFrmBackColor
19: Public mFontName
20: Public iniFileName As String
21: Public mRetries As Integer
22: Public AppName As String
23: Public AppRev As String
24:
25: Public Sub writeOutputFile(argOutput As String)
26:
27: If OutputFlag = Y Then
28:     Open App.Path & \SomeFile.ini For Append As #1
29:     Print #1, argOutput
30:     Close #1
31: End If
32:
continues

 
< previous page page_319 next page >

If you like this book, buy it!